<template>
	<view>
		<page-head :title="addmyinvoice.company_name" :headtype="2"></page-head>
		<view class="xqblock marginAuto">
			<view class="item flex">
				<view class="itemmsg flex">
					<view class="itemmsgtitle">企业名称：</view>
					<view class="itemmsgmsg">{{ addmyinvoice.company_name }}</view>
				</view>
			</view>
			<view class="item flex">
				<view class="itemmsg flex">
					<view class="itemmsgtitle">企业类型：</view>
					<view class="itemmsgmsg" v-if="companytypeg">工业</view>
					<view class="itemmsgmsg" v-if="companytypen">农业</view>
				</view>
			</view>
			<view class="item">
				<view class="itemmsg flex">
					<view class="itemmsgtitle">营业执照：</view>
				</view>
				<view class="itemphoto">
					<image :src="apifun.URLimg + addmyinvoice.business_img" mode="heightFix"></image>
				</view>
			</view>
			<view class="item">
				<view class="itemmsg flex">
					<view class="itemmsgtitle">授权书：</view>
				</view>
				<view class="itemphoto">
					<image :src="apifun.URLimg + addmyinvoice.authorization" mode="heightFix"></image>
				</view>
			</view>
			<view class="item flex" @click="apifun.navigate('/pages/usermy/invoice','noedit=2')">
				<view class="itemmsg flex">
					<view class="itemmsgtitle">开票信息：</view>
				</view>
				<view class="itemicon">
					<uv-icon name="arrow-right" color="#999999" size="20"></uv-icon>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				apifun:this.apifun,
				id:'',
				addmyinvoice:{},
				companytypeg:false,
				companytypen:false
			};
		},
		onLoad(option) {
			this.id = option.id;
			this.getbusinmsgfun()
		},
		methods: {
			getbusinmsgfun(){
				this.apifun.unirequest('/user/company/getCompanyInfo','post',{
					company_id:this.id
				},(res)=>{
					if(res.code === 200){
						let datas = res.data;
						this.addmyinvoice = datas;
						this.companytypeg = datas.company_type.includes('1');
						this.companytypen = datas.company_type.includes('2');
						this.business = datas.business_img;
						this.sqs = datas.authorization;
						let sendData = {
							invoice_type:datas.invoice_type,
							invoice_title:datas.invoice_title,
							invoice_tax:datas.invoice_tax,
							reg_address:datas.reg_address,
							reg_tel:datas.reg_tel,
							bank_name:datas.bank_name,
							bank_account:datas.bank_account
						}
						uni.setStorageSync('addmyinvoice', sendData);
					}else{
						this.apifun.toast(res.msg)
					}
				})
			}
		},
	};
</script>

<style scoped lang="scss">
.xqblock{
	position: relative;
	width: 630rpx;
	padding: 50rpx 30rpx 28rpx;
	background:linear-gradient(to bottom, #F4FAFF,#ffffff);
	border-radius: 10rpx;
	margin-top: 20rpx;
	border:1px solid #EFF1F6;
	margin-top:20rpx;
	justify-content: space-between;
	.item{
		padding: 20rpx 0;
		justify-content: space-between;
		.itemphoto{
			margin-top: 20rpx;
			image{
				height: 220rpx;
			}
		}
		.itemmsg{
			.itemmsgimg{
				width: 40rpx;
				height: 40rpx;
				image{
					width: 40rpx;
					height: 40rpx;
				}
			}
			.itemmsgtitle{
				line-height: 40rpx;
				font-size: 30rpx;
				color:#666666;
			}
			.itemmsgmsg{
				line-height: 40rpx;
				font-size: 30rpx;
				color:#333;
				margin-left: 10rpx;
			}
		}
	}
}
</style>